GtkThemingEngine: Render correctly spinbutton buttons.
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 3 Aug 2010 18:38:23 +0000 (20:38 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:32 +0000 (15:37 +0100)
gtk/gtkthemingengine.c

index f162b311b3a8698033de7271e27d4a7cc7cb1d11..3d43b2f7ba0234b48704cad8726087616d0cc512 100644 (file)
@@ -1009,12 +1009,27 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
     {
       if (gtk_theming_engine_has_class (engine, "button"))
         {
+          GtkJunctionSides sides;
+
+          sides = gtk_theming_engine_get_junction_sides (engine);
+
+          if (sides & GTK_JUNCTION_BOTTOM)
+            y += 2;
+
+          width -= 3;
+          height -= 2;
+
+          if (gtk_theming_engine_get_direction (engine) == GTK_TEXT_DIR_RTL)
+            x += 2;
+          else
+            x += 1;
+
           gdk_cairo_set_source_color (cr, &lighter);
-          add_path_rectangle_sides (cr, x + 1, y + 2, width - 3, height - 2, SIDE_TOP);
+          add_path_rectangle_sides (cr, x, y, width, height, SIDE_TOP);
           cairo_stroke (cr);
 
           gdk_cairo_set_source_color (cr, &darker);
-          add_path_rectangle_sides (cr, x + 1, y + 2, width - 3, height - 2, SIDE_BOTTOM);
+          add_path_rectangle_sides (cr, x, y, width, height, SIDE_BOTTOM);
           cairo_stroke (cr);
         }
       else